package com.yuanduan.mplus.presenter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by cj on 2016/6/16.
 * Email:781806481@qq.com
 */
public class ReportAdapter extends FragmentPagerAdapter {
    private List<Fragment> datas;
    private List<String> titles;
    public ReportAdapter(FragmentManager fm) {
        super(fm);
    }

    public void setData(List<Fragment> lists){
        datas=lists;
    }

    public void setTitles(List<String> lists){
        titles=lists;
    }

    @Override
    public Fragment getItem(int position) {
        return datas.get(position);
    }

    @Override
    public int getCount() {
        return datas.size();
    }

    public List<String> getTitles() {
        return titles;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
}
